/**
 * 用于储存核心文件
 */

import MANA from "./constant";


// localStorage
// 存
export const setStorage = (key,data)=>{
    if(!key)return;
    if(typeof(data) !== MANA.TYPESTRING){
        data = JSON.stringify(data);
    }
    localStorage.setItem(key,data);
}

// 取
export const getStorage = (key)=>{
    if(!key)return;
    return JSON.stringify(localStorage.getItem(key));
}

// 删
export const removeStorage = (key)=>{
    if(!key)return;
    localStorage.removeItem(key)
}

// null
export const clearStorage = ()=>{
    localStorage.clear();
}


// sessionStorage
